<template>
  <div>
    <h2>Count组件</h2>
    <p>我count的值是:{{ count }}</p>
    <p>电影列表的总共有{{ movieList.length }}个电影</p>
    <button @click="increment({ n: 3 })">累加N</button>
    <p>电影长度在3-6的列表如下</p>
    <p v-for="item in movieName3_6" :key="item.tvId">{{ item.name }}</p>
  </div>
</template>

<script>
import { mapMutations, mapState, mapGetters } from "vuex";
export default {
  name: "Count",
  mounted() {
    console.log(this, "Count");
  },
  computed: {
    ...mapState("count", ["count"]),

    /* movieList(){
      return this.$store.state.movie.movieList
    }, */
    ...mapState("movie", ["movieList"]),

    /* movieName3_6() {
      return this.$store.getters["movie/movieName3_6"];
    }, */
    ...mapGetters("movie", ["movieName3_6"]),
  },


  
  methods: {
    /* increment(payload) {
      this.$store.commit("count/increment", payload);
    }, */
    ...mapMutations("count", ["increment"]),
  },
};
</script>

<style scoped></style>
